<template>
  <div class="user-card">
    <div class="user-avatar-container">
      <user-avatar :user="user" :size="64" />
    </div>
    <div class="user-info">
      <div class="user-name">{{ user.username }}</div>
      <div class="user-role" v-if="user.role">{{ user.role }}</div>
      <div class="user-department" v-if="user.department">{{ user.department }}</div>
      <div class="user-email" v-if="user.email">{{ user.email }}</div>
    </div>
    <div class="user-actions" v-if="$slots.actions">
      <slot name="actions"></slot>
    </div>
  </div>
</template>

<script>
import UserAvatar from './UserAvatar.vue';

export default {
  name: 'UserCard',
  components: {
    UserAvatar
  },
  props: {
    user: {
      type: Object,
      required: true
    }
  }
};
</script>

<style scoped>
.user-card {
  display: flex;
  padding: 12px;
  border-radius: 8px;
  background-color: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  margin-bottom: 10px;
  transition: transform 0.3s, box-shadow 0.3s;
}

.user-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.user-avatar-container {
  margin-right: 16px;
  display: flex;
  align-items: center;
}

.user-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.user-name {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 4px;
}

.user-role,
.user-department,
.user-email {
  font-size: 14px;
  color: #666;
  margin-bottom: 2px;
}

.user-actions {
  display: flex;
  align-items: center;
}
</style> 